﻿<?php
							echo $this->blkImageSlide();
?>
<div class="clear"></div>
<!-- CONTENT (start) -->
<div class="detail">
<div id="ajax-load-more-product">
<?php
if(!empty($this->Items)){
	$ssFilter = $this->arrParam['ssFilter'];
	$lang = $ssFilter['lang'];
	if($lang == ''){
		$lang = 'vi';
	}else{
		$lang = $ssFilter['lang'];
	}
	
	$items = $this->Items;
	$i = 0;
	foreach ($items as $key => $value){
		$i++;
		$col = 0;
		if($i%3 == 0) $col = 1;
		$cutTring 	= new Zendvn_File_CutTring();
		$title 		= $value['name'];
		$title 		= str_replace("\\"," ",$title);
		$alt		= $value['name'];
		if(!empty($value['alt_seo'])) $alt = $value['alt_seo'];
		$alt 		= str_replace("\\"," ",$alt);
							
		$summary 	= $value['summary'];
        $summary 	= str_replace("\\"," ",$summary);
		$summary 	= $cutTring->cutTring(100,$summary,null);
		
		if(!empty($value['picture'])){
		    $linkImg	= FILES_URL . '/products/images450x450/' . $value['picture'];
		    $picture 	= '<img title="'. $title .'" src="'. $linkImg .'" width="110" alt="'.$alt.'" />';
		}else{
		    $linkImg	= $this->imgUrl . '/no-image.jpg';
		    $picture 	= '<img title="'. $title .'" src="'. $linkImg .'" width="110" alt="'.$alt.'" />';
		}
		$urlOptions = array(
							'module'=>'default',
							'controller'=>'index',
							'action'=>'detail',
							'title'=>$value['alias'],
							'id'=>$value['id'],
                   			'lang'=>$lang
		);
		
        $linkDetail = $this->url($urlOptions,'products-detail');
        
		$urlAddToCart = array('module'=>'default',
								'controller'=>'index',
								'action'=>'ajax-add-to-cart',
								'id'=>$value['id'],
                   			);
		
        $linkAddtoCart = $this->url($urlAddToCart, 'default');
        
		
        ?>
        <div class="box-cnt width-32 col-<?php echo $col;?> product-col">
                      	    <div class="cnt">
                                <div class="width-100">
                                    <h2 class="title"><a href="<?php  echo  $linkDetail?>"><?php  echo $value["name"] ?></a></h2>
                                </div>
                          	    <div class="bor-img">
                                    <a href="<?php  echo  $linkDetail?>">
                                        <?php  echo  $picture?>
                                    </a>
                                    <div class="clear"></div>
                                   <span class="price"><p><?php  echo number_format($value['price'],0)?> VNĐ</p></span>
                                   <span class="button" style="cursor: hand;">
                                        <a class='icon_cart'  onclick = "datHang1('#ajax-reload-menu','<?php echo $linkAddtoCart?>');" title="dat mua nhanh">
                                            <span class="bold">Thêm</span>
                                            <span>vào t.đơn</span>
                                        </a>
                                   </span>
                                </div>
                                <div class="desc">
                                    <p><?php  echo  $summary ?></p>
                                </div>
                          </div>
          </div>
        
         <?php
	}
} 
?></div><!-- end ajax load more -->
       <div class="clear"></div>
       
<?php 
if($this->Count > $this->count_item_current){
		$urlLoadmoreOptions = array(
								'module'	=>'default',
								'controller'=>'index',
								'action'	=>'ajax-load-more',
								'limit'	=>$this->count_item_current + PRODUCT_TOLOADMORE,
                   			);
        $linkLoadmore = $this->url($urlLoadmoreOptions,'default');
        
?>	        

       <a id="load-more-button"  onclick = "areaLoadUrl('#ajax-load-more-product','<?php echo $linkLoadmore?>'); " title="Xem thêm" class="bg-brown">Xem thêm</a>
       <?php }?>
</div>